package com.ysd.dao.impl;

import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;

import com.ysd.entity.HomeInfo;
import com.ysd.util.DBManage;



public class AboutDao {
	public static HomeInfo getAll(){
		HomeInfo h=null;
		try {
			Connection conn = DBManage.getConn();
			Statement stam = conn.createStatement();
			ResultSet rs=stam.executeQuery("select id,homeInfo,info,culture,zsTel,lxTel,email,address,x,y FROM homeinfo");
			while(rs.next()) {
				 int id = rs.getInt("id");
				 String homeInfo = rs.getString("homeInfo") ;
				 String info = rs.getString("info");
				 String culture = rs.getString("culture");
				 String zsTel = rs.getString("zsTel");
				 String lxTel = rs.getString("lxTel");
				 String email = rs.getString("email");
				 String address = rs.getString("address");
				double x = rs.getDouble("x");
				double y = rs.getDouble("y");
					h=new HomeInfo(id,homeInfo,info,culture,zsTel,lxTel,email,address,x,y);
				}
			DBManage.colseAll(rs, stam, conn);	
		} catch (SQLException e) {
			e.printStackTrace();
		}
			return h;
	} 
		
}
